//
//  BaseModel.m
//  Koala_Fm
//
//  Created by dllo on 16/1/15.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel


-(instancetype)initWithDic:(NSDictionary *)dic{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+(instancetype)modelWithDic:(NSDictionary *)dic{
    id model = [[[self class] alloc] initWithDic:dic];
    return model;
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

+(NSMutableArray *)modelHandlerWithArray:(NSArray *)array{
    NSMutableArray *mArr = [NSMutableArray array];
    for (NSDictionary *dic in array) {
        id model = [[self class] modelWithDic:dic];
        [mArr addObject:model];
    }
    return mArr;
}


@end
